<?php

namespace App\Http\Controllers\Home;

use Chenhua\MarkdownEditor\MarkdownEditor;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    //
    public function index(){
        $basePath=\Config::get('markdowneditor.connections.local.prefix');
        $filename='/laraveltest.md';
        $fillPath='../'.$basePath.$filename;
        $data=file_get_contents($fillPath);
         $data=MarkdownEditor::parse($data);
        return View('home.index.index',compact('data'));



//        $data=file_get_contents($fillPath);
//        $re=\File::put('../uploads/markdown/test.md', 'test content');
//        var_dump($fillPath);die;
//        print_r($data);die;
//        var_dump($data);die;
//        echo $fillPath;die;
//        $re=is_readable($fillPath);
//        var_dump($re);die;
//        uploads/markdown/laraveltest.md
//        uploads/markdown/laraveltest.md
//        uploads/markdown/laravel框架自定义常量和拓展函数.md
//        print_r($data);
//        echo 2;die;
    }
}
